package com.sc.design.proxy.dynamicproxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class MyInvokeHandler implements InvocationHandler {
    Object obj = null;

     MyInvokeHandler(Object _obj){
        this.obj = _obj;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        Object o = method.invoke(this.obj,args);
        if(method.getName().equalsIgnoreCase("login")){
            System.out.println("盗号");
        }
        return o;
    }
}
